#!/bin/sh
#创建速度转速散点表

#hbase命名空间
NAMESPACE=default
count=`echo "list_namespace_tables '${NAMESPACE}'" | hbase shell | grep -w 'SpeedRotateStatistic' | wc -l`
if [ $count -eq 0 ];then
hbase shell <<EOF
create '${NAMESPACE}:SpeedRotateStatistic',{NAME => 'd', COMPRESSION => 'SNAPPY', DATA_BLOCK_ENCODING => 'FAST_DIFF',TTL => '15552000'}, {NUMREGIONS => 10, SPLITALGO => 'HexStringSplit'},{SPLITS => ['1|','2|','3|','4|','5|','6|','7|','8|','9|']},
{METADATA => {'SPLIT_POLICY' => 'org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy', 'MAX_FILESIZE' => '53687091200'}}
EOF
fi

#删除表
#disable 'SpeedRotateStatistic'
#drop 'SpeedRotateStatistic'